package com.Iconcat.system.service.impl;

import com.Iconcat.system.entity.Notification;
import com.Iconcat.system.mapper.NotificationMapper;
import com.Iconcat.system.service.NotificationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zzq
 * @since 2023-11-17
 */
@Service
public class NotificationServiceImpl extends ServiceImpl<NotificationMapper, Notification> implements NotificationService {

    @Resource
    private NotificationMapper notificationMapper;

    public void sendNotification(Notification notification) {
        // 设置通知的发送时间
        notification.setSentAt(new Date());
        // 保存通知到数据库
        notificationMapper.insert(notification);
        // 其他逻辑...
    }
}
